import tkinter as tk
from tkinter import ttk
from GUI界面.BaseSubWindow import BaseSubWindow

class AboutWindow(BaseSubWindow):
    """用户信息"""
    def create_widgets(self):
        gender = None
        if self.user:
            gender = '男' if self.user.gender == 0 else '女'

        ttk.Label(self, text="关于作者", font=('Arial', 14)).pack(pady=10)

        info = f"""
        姓名：{self.user.username if self.user else '未知'}
        性别：{gender if self.user else '未知'}
        年龄：{self.user.age if self.user else '未知'}
        职业：全栈开发者
        技能：Python/Java/JavaScript
        联系方式：xxx@example.com
        """
        text = tk.Text(self, wrap=tk.WORD, height=8)
        text.pack(fill=tk.BOTH, expand=True)
        text.insert(tk.END, info)
        text.config(state=tk.DISABLED)